
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for comSchgrp.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="comSchgrpForm"
 */
public class ComSchgrpForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _csGuid = null;
   private java.lang.String _schId = null;
   private java.lang.String _tbCategory = null;

   /**
    * Standard constructor.
    */
   public ComSchgrpForm() {
   }

   /**
    * Returns the csGuid
    *
    * @return the csGuid
    */
   public java.lang.String getCsGuid() {
      return _csGuid;
   }

   /**
    * Sets the csGuid
    *
    * @param csGuid the new csGuid value
    */
   public void setCsGuid(java.lang.String csGuid) {
      _csGuid = csGuid;
   }
   /**
    * Returns the schId
    *
    * @return the schId
    */
   public java.lang.String getSchId() {
      return _schId;
   }

   /**
    * Sets the schId
    *
    * @param schId the new schId value
    */
   public void setSchId(java.lang.String schId) {
      _schId = schId;
   }
   /**
    * Returns the tbCategory
    *
    * @return the tbCategory
    */
   public java.lang.String getTbCategory() {
      return _tbCategory;
   }

   /**
    * Sets the tbCategory
    *
    * @param tbCategory the new tbCategory value
    */
   public void setTbCategory(java.lang.String tbCategory) {
      _tbCategory = tbCategory;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCsGuid() == null) {
         errors.add("csGuid", new ActionError("error.csGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
